<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<html>
<head>
    <title>添加线路</title>
    <link rel="stylesheet" href="${pageContext.request.contextPath}/css/bootstrap.min.css">
    <style>
        body {
            background-color: #f8f9fa;
            font-family: 'Segoe UI', sans-serif;
        }
        .form-container {
            max-width: 800px;
            margin: 40px auto;
            padding: 30px;
            background: #fff;
            border-radius: 8px;
            box-shadow: 0 4px 6px rgba(0,0,0,0.1);
            transition: all 0.3s ease;
        }
        .form-container:hover {
            box-shadow: 0 6px 12px rgba(0,0,0,0.15);
        }
        h1 {
            color: #2c3e50;
            margin-bottom: 30px;
            font-weight: 600;
            text-shadow: 1px 1px 2px rgba(0,0,0,0.1);
        }
        .form-group {
            margin-bottom: 20px;
        }
        .form-group label {
            color: #495057;
            font-weight: 500;
            margin-bottom: 8px;
        }
        .form-control {
            border-radius: 4px;
            border: 1px solid #ced4da;
            transition: border-color 0.3s ease;
            padding: 10px 15px;
        }
        .form-control:focus {
            border-color: #80bdff;
            box-shadow: 0 0 0 0.2rem rgba(0,123,255,0.25);
        }
        .btn-primary {
            background-color: #3498db;
            border: none;
            padding: 10px 25px;
            border-radius: 4px;
            transition: all 0.3s ease;
        }
        .btn-primary:hover {
            background-color: #2980b9;
            transform: translateY(-1px);
        }
        .btn-secondary {
            background-color: #95a5a6;
            border: none;
            padding: 10px 25px;
            border-radius: 4px;
            transition: all 0.3s ease;
        }
        .btn-secondary:hover {
            background-color: #7f8c8d;
            transform: translateY(-1px);
        }
        .btn-group {
            margin-top: 30px;
        }
        .btn-group .btn {
            margin-right: 10px;
        }
    </style>
</head>
<body>
    <div class="container">
        <h1 class="text-center">添加线路</h1>
        <div class="form-container">
            <form action="${pageContext.request.contextPath}/route/insert" method="post" enctype="multipart/form-data">
                <div class="form-group">
                    <label for="route_name">线路名称：</label>
                    <input type="text" class="form-control" id="route_name" name="route_name" required>
                </div>
                <div class="form-group">
                    <label for="route_start_place">出发地：</label>
                    <input type="text" class="form-control" id="route_start_place" name="route_start_place" required>
                </div>
                <div class="form-group">
                    <label for="route_end_place">目的地：</label>
                    <input type="text" class="form-control" id="route_end_place" name="route_end_place" required>
                </div>
                <div class="form-group">
                    <label for="route_price">价格：</label>
                    <input type="number" class="form-control" id="route_price" name="route_price" min="0" step="0.01" required>
                </div>

                <div class="form-group">
                    <label for="route_day">天数：</label>
                    <input type="number" class="form-control" id="route_day" name="route_day" min="1" required>
                </div>


                <div class="form-group">
                    <label for="column_id">分类：</label>
                    <select class="form-control" id="column_id" name="column_id" required>
                        <c:forEach items="${columns}" var="column">
                            <option value="${column.column_id}">${column.column_name}</option>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group">
                    <label for="description">描述：</label>
                    <textarea class="form-control" id="description" name="description" rows="5" required></textarea>
                </div>
                <div class="form-group">
                    <label for="business_id">商家：</label>
                    <select class="form-control" id="business_id" name="business_id" required>
                        <c:forEach items="${businesses}" var="business">
                            <c:if test="${houuser.sid == 0 || business.business_id == houuser.sid}">
                                <option value="${business.business_id}">${business.business_name}</option>
                            </c:if>
                        </c:forEach>
                    </select>
                </div>
                <div class="form-group">
                    <label for="rimage">图片：</label>
                    <input type="file" class="form-control" id="rimage" name="image">
                </div>

<%--                <div class="form-group">--%>
<%--                    <label for="route_type">类型：</label>--%>
<%--                    <select class="form-control" id="route_type" name="route_type" required>--%>
<%--                        <option value="跟团游">跟团游</option>--%>
<%--                        <option value="自由行">自由行</option>--%>
<%--                        <option value="一日游">一日游</option>--%>
<%--                        <option value="游轮">游轮</option>--%>
<%--                    </select>--%>
<%--                </div>--%>
                <div class="form-group">
                    <label for="route_special">是否特价：</label>
                    <select class="form-control" id="route_special" name="route_special" required>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </div>


<%--                <div class="form-group">--%>
<%--                    <label for="routeSpecial">特殊说明：</label>--%>
<%--                    <textarea class="form-control" id="routeSpecial" name="routeSpecial" rows="5" required></textarea>--%>
<%--                </div>--%>
                <div class="form-group">
                    <label for="recommend">推荐：</label>
                    <select class="form-control" id="recommend" name="recommend" required>
                        <option value="0">推荐</option>
                        <option value="1">不推荐</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="isrouteCarousel">是否轮播：</label>
                    <select class="form-control" id="isrouteCarousel" name="carousel" required>
                        <option value="1">是</option>
                        <option value="0">否</option>
                    </select>
                </div>

                <div class="form-group">
                    <label for="routeCarousel">轮播图：</label>
                    <input type="file" class="form-control" id="routeCarousel" name="image2">
                </div>

                <div class="form-group">
                    <label for="routePhoto">副图：</label>
                    <input type="file" class="form-control" id="routePhoto" name="image3" multiple>
                </div>

<%--                <div class="form-group">--%>
<%--                    <label for="routePhoto">缩略图：</label>--%>
<%--                    <input type="file" class="form-control" id="routePhoto" name="image3">--%>
<%--                </div>--%>

                <div class="form-group text-center btn-group">
                    <button type="submit" class="btn btn-primary">提交</button>
                    <button type="reset" class="btn btn-secondary">重置</button>
                </div>
            </form>
        </div>
    </div>
    <script src="${pageContext.request.contextPath}/js/jquery-3.3.1.js"></script>
    <script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
</body>
</html>